import request from '@/utils/request'

export function apiDetailBase(unid) {
    return request({
        api: 'mgop.linewell.eraq.archiveBase',
        url: "/api/eraq/archive/base",
        method: 'get',
        params: {
            unid, from: "1"
        },
        loadText: "资料加载中..."
    });
}

export function apiDetailChange(unid) {
    return request({
        api: 'mgop.linewell.eraq.archiveChange',
        url: "/api/eraq/archive/change",
        method: 'get',
        params: {
            unid, from: "1"
        },
        loadText: "资料加载中..."
    });
}

//内档查询企业列表
export function entsList(unid) {
    return request({
        api: 'mgop.linewell.eraq.supplyInnerView',
        url: "/api/eraq/supply/inner/view",
        method: 'get',
        params: {
            unid
        },
        loadText: "档案目录加载中..."
    });
}

//加载内档目录
export function indexList(unid) {
    return request({
        api: 'mgop.linewell.eraq.archiveIndex',
        url: "/api/eraq/archive/index",
        method: 'get',
        params: {
            unid
        },
        loadText: "档案目录加载中..."
    });
}

//调取档案PNG文件
export function getPng(code,unid) {
    return request({
        api: 'mgop.linewell.eraq.archiveInner',
        url: "/api/eraq/archive/inner",
        method: 'get',
        params: {
            unid,
            typeCode:code
        }
    });
}

//调取档案PDF文件
export function getPdf(code,unid) {
    return request({
        api: 'mgop.linewell.eraq.archivePdf',
        url: "/api/eraq/archive/pdf",
        method: 'get',
        params: {
            unid,
            typeCode:code
        }
    });
}

//调取档案目录的材料清单
export function apiGetArchiveIndex(unid, typeCode) {
    return request({
        api: 'mgop.linewell.eraq.archiveIndexList',
        url: "/api/eraq/archive/index/list",
        method: 'get',
        params: {
            unid, typeCode
        },
        loadText: "目录调取中"
    });
}

//调取档案签章文件
export function apiGetArchive(unid, code, type) {
    console.log(code);
    return request({
        api: 'mgop.linewell.eraq.archiveSeal',
        url: "/api/eraq/archive/seal",
        method: 'get',
        params: {
            unid,
            infoType: type,
            typeCode: code
        },
        loadText: "正在生成档案"
    });
}

//获取签章后的PDF文件
export function apiDownloadPdf(unid, infoType, typeCode) {
    return request({
        api: 'mgop.linewell.eraq.archiveSeal',
        url: "/api/eraq/archive/seal",
        method: 'get',
        params: {
            unid, infoType, typeCode
        },
        loadText: "正在生成"
    });
}
